﻿@model IEnumerable<Vacation.Models.UserListModel>

@{
    ViewBag.Title = "用户列表";
}

<h2>用户列表</h2>

<p>
    @Html.ActionLink("创建用户", "UserCreate")
</p>
@using (Html.BeginForm())
{
    <p>
        姓名: @Html.TextBox("RealName","%")  学院： @Html.DropDownList("School")
        <input type="submit" value="查找" /></p>
}
<table class="infolist">
    <tr>
      <th></th>
        <th>
            用户 名
        </th>
        <th>
            姓名
        </th>
        <th>
            学院
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("修改密码", "UserEdit", new { UserName=item.UserName }) |
            @Html.ActionLink("详情", "UserDetail", new { UserName = item.UserName })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RealName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.School)
        </td>

    </tr>
}
</table>
<div class="paged">   
    @Html.ActionLink("首页", "UserIndex", new { page = 1, realname=ViewBag.Name,school=ViewBag.SchoolCode })
    @Html.Raw(" ")
    @Html.ActionLink("上页", "UserIndex", new { page = ViewBag.LastPage,realname=ViewBag.Name,school=ViewBag.SchoolCode })
    @Html.Raw(" ")
    @Html.ActionLink("下页", "UserIndex", new { page = ViewBag.NextPage, realname = ViewBag.Name, school = ViewBag.SchoolCode })
    @Html.Raw(" ")
    @Html.ActionLink("尾页", "UserIndex", new { page = ViewBag.EndPage, realname = ViewBag.Name, school = ViewBag.SchoolCode })
    @Html.Raw(" 第"+ViewBag.CurrPag+"页 共"+ViewBag.PageCount+"页 共找到"+ViewBag.RecordCount+"条记录 每页"+ViewBag.PageSize+"条")
</div>
